package Thread;

//5.使用lambda表达式
public class Test05 {
    static int count;
    public static void main(String[] args) throws InterruptedException {
        Thread t = new Thread(()->{
            while (true){
                System.out.println(count++);
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        });
        t.start();
        while (true){
            System.out.println("我是main线程");
            Thread.sleep(1000);
        }
    }
}
